<?php

class Tools {

	public static  function randomValue($length =32) {
		
		$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890';
		$chars_length = (strlen($chars) - 1);
		$string = $chars{rand(0, $chars_length)};
		 for ($i = 1; $i < $length; $i = strlen($string))
    	{
        $randChar = $chars{rand(0, $chars_length)};
        
        if ($randChar != $string{$i - 1}) $string .=  $randChar;
    	}
    
    return $string;
		
	}
}

?>